#pragma once

#include "CmdHandler3.h"

class Ent;
class Polygon;
class PolygonWithHolesHandler : public CmdHandler3
{
	Q_OBJECT
public:
	Q_INVOKABLE PolygonWithHolesHandler();
	~PolygonWithHolesHandler();

	virtual void input(const QVariant& data, const QString& rawInput, CommandSource cs) override;
protected:
	std::vector<osg::Vec3d> m_outerloop;
	std::vector<std::vector<osg::Vec3d>> m_innerloops;

	void doIt();
};

class LineStrip3D;
class PointHandler;
class PolygonWithHoles2Handler : public PolygonWithHolesHandler
{
	Q_OBJECT
public:
	Q_INVOKABLE PolygonWithHoles2Handler();
	~PolygonWithHoles2Handler();

	virtual void input(const QVariant& data, const QString& rawInput, CommandSource cs) override;
private:
	std::shared_ptr<LineStrip3D> m_line;
	std::shared_ptr<PointHandler> m_pointStateMachine;
};
